﻿<%@ Page Language="C#" Title="Cungmuanao.com - Quản lý User" AutoEventWireup="true" CodeFile="ManageUser.aspx.cs" MasterPageFile="~/Admin/Admin.master" Inherits="Admin_ManageUser" %>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
 <div class="title">Quản lý User</div>
    <!-- bat Dau -->
    <div class="body">   
        
            <ul style="list-style-type: circle">
                <li>
                    <asp:HyperLink ID="hplAddNewAccount" runat="server" NavigateUrl="~/Admin/AddUser.aspx">thêm người dùng mới</asp:HyperLink>
                </li>
            </ul>
            <ul style="list-style-type: circle">
                 <li>
                    <asp:HyperLink ID="hplPasswordRecovery" runat="server" NavigateUrl="~/Admin/PasswordRecovery.aspx">nhắc mật khẩu</asp:HyperLink>
                </li>
            </ul>
        <hr />
        <p></p>
        <b>- Total users: <asp:Literal runat="server" ID="lblTotUsers" /><br />
        - Users online now: <asp:Literal runat="server" ID="lblOnlineUsers" /></b>
        <p></p>
        Click one of the following link to display all users whose name begins with that letter:
        <p></p>
        <asp:Repeater runat="server" ID="rptAlphabet" 
            onitemcommand="rptAlphabet_ItemCommand">
                <ItemTemplate>
                <asp:LinkButton ID="LinkButton1" runat="server" Text='<%# Container.DataItem %>' CommandArgument='<%# Container.DataItem %>' />
                &nbsp;&nbsp;
                </ItemTemplate>
        </asp:Repeater>
        <p></p>
        Otherwise use the controls below to search users by partial username or e-mail:
        <p></p>
        <asp:DropDownList runat="server" ID="ddlSearchTypes">
            <asp:ListItem Text="UserName" Selected="true" />
            <asp:ListItem Text="E-mail" />
        </asp:DropDownList> 
        contains 
        <asp:TextBox runat="server" ID="txtSearchText" /> 
        <asp:Button runat="server" ID="btnSearch" Text="Search" 
            onclick="btnSearch_Click"  />
         <p></p>
          <asp:GridView ID="gvwUsers" runat="server" AutoGenerateColumns="False" 
                DataKeyNames="UserName" Width="100%" BackColor="White" 
                BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" 
            CellPadding="4" onrowcreated="gvwUsers_RowCreated" 
            onrowdeleting="gvwUsers_RowDeleting">
                <RowStyle ForeColor="#330099" BackColor="White" />
                <Columns>
                    <asp:BoundField HeaderText="UserName" DataField="UserName" />
                    <asp:HyperLinkField HeaderText="E-mail" DataTextField="Email" DataNavigateUrlFormatString="mailto:{0}" DataNavigateUrlFields="Email" />
                    <asp:BoundField HeaderText="Created" DataField="CreationDate" DataFormatString="{0:MM/dd/yy h:mm tt}" />
                    <asp:BoundField HeaderText="Last activity" DataField="LastActivityDate" DataFormatString="{0:MM/dd/yy h:mm tt}" />
                    
                    <asp:CheckBoxField HeaderText="Approved" DataField="IsApproved" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" >
                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </asp:CheckBoxField>
                    <asp:HyperLinkField HeaderText="Edit"  Text="<img src='../Images/Edit.gif' border='0' />" DataNavigateUrlFormatString="EditUser.aspx?UserName={0}" 
                        DataNavigateUrlFields="UserName" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" >
                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </asp:HyperLinkField>
                    <asp:ButtonField HeaderText="Delete" CommandName="Delete" ButtonType="Image" ImageUrl="~/Images/Delete.gif"
                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" >
                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </asp:ButtonField>
                </Columns>
                <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                <EmptyDataTemplate><b>No users found for the specified criteria</b></EmptyDataTemplate>
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
          </asp:GridView>
     <!-- Bat Dau -->   
    </div>
    <div class="bottom"></div>
</asp:Content>